//spu数据类型

//服务器返回的基础数据类型
export interface T_ResponseData {
    code: number,
    message: string,
    ok: boolean
}

//spu数据的ts类型
export interface T_SpuData {
    id?: number,
    spuName: string,
    description: string,
    category3Id: string | number,
    tmId: number | string,
    spuSaleAttrList: null | T_SaleAttr[],
    spuImageList: null | T_SpuImage[]
}

//定义获取已有spu接口返回数据ts类型
export interface T_SpuResponseData extends T_ResponseData {
    data: {
        records: T_SpuData[],
        total: number,
        size: number,
        current: number,
        searchCount: boolean,
        pages: number
    }
}

//品牌数据的ts类型
export interface T_Trademark {
    id: number,
    tmName: string,
    logoUrl: string
}

//品牌接口返回的ts类型
export interface T_AllTradeMarkResponse extends T_ResponseData {
    data: T_Trademark[]
}

//商品图片的ts类型
export interface T_SpuImage {
    id?: number,
    createTime?: string,
    updateTime?: string,
    spuId?: number,
    imgName: string,
    imgUrl: string
}

//照片墙数据的类型
export interface T_SpuImageResponse extends T_ResponseData {
    data: T_SpuImage[]
}

//已有的销售属性值对象ts类型
export interface T_SaleAttrValue {
    id?: number,
    createTime?: null,
    updateTime?: null,
    spuId?: number,
    baseSaleAttrId: number,
    saleAttrValueName: string,
    saleAttrName?: string,
    isChecked?: null
}

//销售属性对象ts类型
export interface T_SaleAttr {
    id?: number,
    createTime?: null,
    updateTime?: null,
    spuId?: number,
    baseSaleAttrId: number,
    saleAttrName: string,
    spuSaleAttrValueList: T_SaleAttrValue[]
}

//SPU销售属性接口返回的数据 ts类型
export interface T_SaleAttrResponseData extends T_ResponseData {
    data: T_SaleAttr[]
}


//已有的全部SPU的返回数据ts类型
export interface T_HasSaleAttr {
    id: number,
    name: string
}

//销售属性的ts类型
export interface T_SaleAllAttrResponse extends T_ResponseData {
    data: T_HasSaleAttr[]
}


//平台属性ts类型
export interface T_Attr {
    attrId: number | string,
    valueId: number | string
}

//销售属性ts类型
export interface T_saleAttr {
    saleAttrId: number | string,
    saleAttrValueId: number | string
}

//新增sku的数据类型
export interface T_SkuData {
    category3Id: string | number,
    spuId: string | number,
    tmId: string | number,
    skuName: string,
    price: string | number,
    weight: string | number,
    skuDesc: string,
    skuDefaultImg: string,
    skuAttrValueList: T_Attr[],
    skuSaleAttrValueList: T_saleAttr[]
}

//返回sku的数据类型
export interface T_SkuInfoResponseData extends T_ResponseData {
    data: T_SkuData[]
}